package com.rocksea.app.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.rocksea.app.activity.PileInfoActivity;
import com.rocksea.app.R;

/**
 * Created by Mrw on 2017/10/17.
 * 桩描述 适配器
 *
 */

public class DescrAdapter extends BaseAdapter
{
    private Context context;
    private String[] lists;

    public DescrAdapter(Context context, String[] lists)
    {
        this.context = context;
        this.lists = lists;
    }

    @Override
    public int getCount() {
        return lists.length;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position)
    {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent)
    {
        if (convertView==null)
            convertView = View.inflate(context, R.layout.descr_item_layout,null);
        TextView mTitle = (TextView) convertView.findViewById(R.id.Title);
        TextView mDesrcibing = (TextView) convertView.findViewById(R.id.Desrcibing);
        String[] content = lists[position].split(PileInfoActivity.LABLE);
        mTitle.setText(content[0]);
        mDesrcibing.setText(content[1]);
        return convertView;
    }
}
